{template 'common/header'}
{template 'web/task/navs'}
<div class="panel panel-default">
    <div class="panel-heading">
        添加字段
    </div>
    <div class="panel-body">
        <form action="" method="post"  class="form-horizontal" enctype="multipart/form-data">
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">顺序</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <input type="text" name="displayorder" placeholder="" value="{$item['displayorder']}" class="form-control"/>
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">所属分类</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <select name="category_id" id="" class="form-control">
                        {php $options = M('category')->getall()}
                        <option value="0">请选择</option>
                        {loop $options $option}
                        <option value="{$option['id']}" {if $item['category_id']==$option['id']}selected{/if}>{$option['title']}</option>
                        {/loop}
                    </select>
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">类型</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <select name="type" id="" class="form-control">
                        {php $options = M('category_field')->getFields()}
                        <option value="0">请选择</option>
                        {loop $options $option}
                        <option value="{$option['code']}" {if $item['type']==$option['code']}selected{/if}>{$option['title']}</option>
                        {/loop}
                    </select>
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">字段名</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <input type="text" name="title" placeholder="" value="{$item['title']}" class="form-control"/>
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">输入提醒</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <input type="text" name="placeholder" placeholder="" value="{$item['placeholder']}" class="form-control"/>
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">错误提醒</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <input type="text" name="warning" placeholder="" value="{$item['warning']}" class="form-control"/>
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">必填</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <label class="radio-inline">
                        <input type="radio" name="need" value="1" {if $item['need']==1}checked="checked"{/if}> 开启
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="need" value="0" {if $item['need']==0}checked="checked"{/if}> 关闭
                    </label>
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-md-offset-2 col-lg-offset-1 col-xs-12 col-sm-10 col-md-10 col-lg-11">
                    <input name="submit" type="submit" value="提交" class="btn btn-primary span3" />
                    <input type="hidden" name="token" value="{$_W['token']}" />
                </div>
            </div>
        </form>
    </div>
</div>
{template 'common/footer'}